<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>管理中心 - 添加资源</title>
	<%@ include file="/common/meta.jsp" %>
	<link href="${ctx}/css/system/general.css" rel="stylesheet" type="text/css" />
	<link href="${ctx}/css/system/main.css" rel="stylesheet" type="text/css" />
	<link href="${ctx}/css/system/category.css" rel="stylesheet" type="text/css" />	
	<script type="text/javascript" src="${ctx}/js/checkFrameSet.js"></script>
	<script type="text/javascript" src="${ctx}/js/jquery-1.4.min.js"></script>
	<script type="text/javascript" src="${ctx}/js/json.min.js"></script>
	<script type="text/javascript" src="${ctx}/js/resource.js">
    </script>
	<script language="JavaScript">
	var contextPath = "${ctx}";
	 $(document).ready(
	 function(){
	        findCategoryList();
	 }
	 ); 
	</script>
      <style>
       <!--
        body{
      	   font-size:13px;
      	}
       -->
      </style> 
</head>
<body>
<h1>
<span class="action-span"><a href="${ctx}/system/resource/manage">操作权限列表</a></span>
<span class="action-span1"><a href="#">管理中心</a>  - 添加操作权限 </span>
<div style="clear:both"></div>
</h1>

<div class="main-div">
  <form:form modelAttribute="resource" action="${ctx}/system/resource" method="post" name="theForm" id="theForm" onsubmit="this.submit.disabled='true';">
  <input type="hidden" name="p_cate_id" id="p_cate_id" value=""/>
  <input type="hidden" name="is_leaf" id="is_leaf" value=""/>
  <form:hidden path="isLeaf" />
  <table width="100%" id="general-table">
      <tr>
        <td class="label"><form:label for="name" path="name" cssErrorClass="error">操作权限名称</form:label></td>
        <td>
          <form:input path="name" maxlength="20" size="27" /> <font color="red">*</font> <form:errors path="name" /></td>
      </tr>
      <tr>
        <td class="label"><form:label for="url" path="url" cssErrorClass="error">操作URI</form:label></td>
        <td><form:input path="url" maxlength="120" size="27" /> <font color="red">*</font> <form:errors path="url" /></td>
      </tr>
      <tr>
        <td class="label">上级操作权限</td>
        <td>
	       <div class="cascading-container">
		    <ol id="J_OlCascadingList">
		      <li id="l_1" class="root">
		        <ul id="u_1">
		           <li id="-1" class="selected"><span>--根操作权限--</span></li>
			           <c:forEach items="${resourceList}" var="itemTemp">
			             <c:choose>
			                <c:when test="${itemTemp.isLeaf==0}">
			           <li id="${itemTemp.id}" class="parent"><span>${itemTemp.name}</span></li>
			                </c:when>
			                <c:otherwise>
			           <li id="${itemTemp.id}"><span>${itemTemp.name}</span></li>
			                </c:otherwise>
			             </c:choose>
			           </c:forEach>
		        </ul>
		      </li>
		    </ol>
		  </div>
        </td>
      </tr>

      <tr>
        <td class="label">是否是菜单项</td>
        <td>
          <form:select path="isMenu">
            <form:option value="1">是</form:option>
            <form:option value="0">否</form:option>
          </form:select>
        </td>
      </tr>
      <tr>
        <td class="label">排序</td>
        <td>
          <form:input path="sortOrder" size="15" /></td>
      </tr>
      </table>
      <div class="button-div">
        <input type="submit" value=" 确定 " />
        <input type="reset" value=" 重置 " />
      </div>
  </form:form>
</div>
</body>
</html>